import java.awt.Color;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;

import javax.swing.JPanel;


public abstract class Dessin extends JPanel implements MouseMotionListener, MouseListener{
	private static final long serialVersionUID = 1L;
	
	int xDebut;
	int yDebut;
	Color defaultColor;
	
	public Dessin()
	{
		addListener();
		defaultColor = Color.red;
		setBackground(defaultColor);
	}
	
	public void removeListener()
	{
		removeMouseListener(this);
		removeMouseMotionListener(this);
	}
	
	public void addListener()
	{
		addMouseListener(this);
		addMouseMotionListener(this);
	}

	public abstract void mousePressed(MouseEvent e);

	public abstract void mouseDragged(MouseEvent e);
	
	public void setColor(Color c)
	{
		defaultColor = c;
	}
	
	@Override
	public void mouseClicked(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseEntered(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseExited(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}
	
	@Override
	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}
	
	@Override
	public void mouseMoved(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

}
